﻿using DDD.Core;
using DDD.Domain;
using MediatR;

namespace DDD.Application
{
    public interface IIntegrationEventHandler : IIntegrationEvent
    {
        //IMediator mediator { get; set; }

        //[CapSubscribe(nameof(TIntegrationEvent))]
        //Task Handle<TIntegrationEvent>(TIntegrationEvent @event, CancellationToken cancellationToken = default);
    }

    public interface IIntegrationEventHandler<in TIntegrationEvent>
        where TIntegrationEvent : IIntegrationEvent
    {
        //IMediator mediator { get; set; }

        [CapSubscribe(nameof(TIntegrationEvent))]
        Task Handle(TIntegrationEvent @event, CancellationToken cancellationToken = default);
    }
}
